package com.how.diaryfriend.data;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import java.util.List;

@Dao
public interface DiaryDao {
    @Insert
    void insertDiary(Diary... diaries);

    @Update
    void updateDiary(Diary... diaries);

    @Delete
    void deleteDiary(Diary... diaries);

    @Query("SELECT * FROM DIARY ORDER BY ID DESC")
    LiveData<List<Diary>> selectAll();
}
